<extend name="Public/base"/>

<!-- 子导航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>


<block name="body">
    <!-- 标题 -->
    <div class="main-title">
        <h2>
            职位信息
        </h2>
    </div>


    <!-- 数据表格 -->
    <div class="data-table">
        <table class="">
            <thead>
            <tr>
                <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                <th class="">id</th>
                <th class=""style = "width: 60px">公司名字</th>
                <th class=""style = "width: 60px">联系电话</th>
                <th class="">联系人</th>
                <th class="">公司地址</th>
                <th class="">公司简介</th>
                <th class=""style = "width: 60px">职位名称</th>
                <th class="">薪资</th>
                <th class=""style = "width: 60px">职位标题</th>
                <th class=""style = "width: 60px">工作地点</th>
                <th class="" style = "width: 60px">职位性质(1为全职;0为兼职)</th>
                <th class=""style = "width: 60px">职位要求</th>
                <th class="">职位描述</th>
                <th class="">需求人数</th>
                <th class="">操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="list" id="vo">
                <tr>
                    <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>

                    <td><span>{$vo['id']}</span></td>
                    <td><span>{$vo['companyname']}</span></td>
                    <td><span>{$vo['name']}</span></td>
                    <td><span>{$vo['mobile']}</span></td>
                    <td><span>{$vo['site']}</span></td>
                    <td><span>{$vo['companyprofile']}</span></td>
                    <td><span>{$vo['title']}</span></td>
                    <td><span>{$vo['pay']}</span></td>
                    <td><span>{$vo['jobtitle']}</span></td>
                    <td><span>{$vo['jobfield']}</span></td>
                    <td><span>{$vo['fulltime']}</span></td>
                    <td><span>{$vo['requirement']}</span></td>
                    <td><span>{$vo['describe']}</span></td>
                    <td><span>{$vo['number']}</span></td>


                    <td>
                        <a href="{:U('Article/company_job_edit?&id='.$vo['id'])}">编辑</a>
                        <a href="{:U('Article/shanchu_job?id='.$vo['id'])}" >删除</a>
                    </td>
                </tr>
            </volist>
            </tbody>
        </table>


    </div>

    <!-- 分页 -->
    <div class="page">
        {$_page}
    </div>
    </div>

</block>
<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        $(function(){
            //搜索功能
            $("#search").click(function(){
                var url = $(this).attr('url');
                var status = $("#sch-sort-txt").attr("data");
                var query  = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
                query = query.replace(/^&/g,'');
                if(status != ''){
                    query = 'status=' + status + "&" + query;
                }
                if( url.indexOf('?')>0 ){
                    url += '&' + query;
                }else{
                    url += '?' + query;
                }
                window.location.href = url;
            });

            /* 状态搜索子菜单 */
            $(".search-form").find(".drop-down").hover(function(){
                $("#sub-sch-menu").removeClass("hidden");
            },function(){
                $("#sub-sch-menu").addClass("hidden");
            });
            $("#sub-sch-menu li").find("a").each(function(){
                $(this).click(function(){
                    var text = $(this).text();
                    $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
                    $("#sub-sch-menu").addClass("hidden");
                })
            });

            //回车自动提交
            $('.search-form').find('input').keyup(function(event){
                if(event.keyCode===13){
                    $("#search").click();
                }
            });

            $('#time-start').datetimepicker({
                format: 'yyyy-mm-dd',
                language:"zh-CN",
                minView:2,
                autoclose:true
            });

            $('#datetimepicker').datetimepicker({
                format: 'yyyy-mm-dd',
                language:"zh-CN",
                minView:2,
                autoclose:true,
                pickerPosition:'bottom-left'
            })

        })
    </script>
</block>
